﻿using System;
using System.Collections.Generic;
using System.Text;
using Data;
using Service;
using Security;
using System.Web.Security;

namespace Security
{
    public class Seguridad
    {
        #region Procedures
        public Seguridad()
        { }

        #endregion
        #region Metodos

        public SimpleVisitante LoadCurrentUserFromMembership()
        {
            MembershipUser mu = System.Web.Security.Membership.GetUser();
            if (mu != null)
            {
                int UserId = (int)mu.ProviderUserKey;
                SimpleVisitante sv = new VisitadorSvr().getUserById(UserId);
                return sv;
            }
            {
                return null;
            }
        }

        #endregion
    }
}
